package TAIC.util ; 
import java.util.* ;
import java.io.* ;

class TransAll {
	public static void main ( String s [] ) {
		File cur = new File ( ".\\" ) ;
		File [] files = cur.listFiles () ;
		for ( File aFile : files ) transOne ( aFile ) ;
		System.out.println ( "Done" ) ;
	}
	
	static void transOne ( File file ) {
		try {
			int n , m , i, j ;
			Scanner scanner = new Scanner ( file ) ;
			if ( ! file.getName().endsWith( ".txt"))  return ;
			PrintStream fout = new PrintStream ( file.getName().replace("txt","out") ) ;
			/*n = Integer.valueOf ( s [ 1 ] ) ;
			m = Integer.valueOf ( s[ 2 ] ) ;*/
			n = scanner.nextInt () ;
			m = scanner.nextInt () ;
			for ( i =0 ; i < n ; i ++ ) {
				for ( j = 0 ; j < m ; j ++ ) {
					fout.print ( scanner.nextDouble () + "\t" ) ;
					scanner.nextDouble () ;
				}
				fout.println () ; 
			}	
		}
		catch ( Exception e ) {
			e.printStackTrace () ; 
		}
	}
	
}